<template>
    <div>
        <h1>你好，我是子组件</h1>
        <h1>{{msg}}</h1>
        <button @click="fun">按钮</button>
    </div>
</template>
<script>
export default {
    props:["msg"],
    data(){
        return {
            message:"我是子级数据，我要传到父级"
        }
    },
    methods:{
        fun(){
            this.$emit("sendToFather",this.message)
        }
    }
}
</script>